<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>汇率管理</title><body class="withvernav">
<style type="text/css">
	thead tr td{
		vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000 !important ; text-align: center;
	}
</style>
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">货币汇率管理</h1>
     
</div>
<!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
          <!--搜索栏-->
           
    <form class="stdform stdform2" method="get" action="/MoneyRateManage/index">
      <div class="tableoptions" style="height:32px;">
      <div style="float:left;">
       货币符号:
       <input type="text" name="sch_name" id="sch_name" class="width100" value="{{$sch_name}}" placeholder="货币符号" />
       货币名称:
       <input type="text" name="sch_namecn" id="sch_namecn" class="width100" value="{{$sch_namecn}}" placeholder="货币名称" />
       &nbsp;&nbsp;
        <button class="btn btn_orange btn_search radius50">Search</button> &nbsp;&nbsp; <a href="javascript:void(0)" onClick="addMoneyRate()" class="btn btn2 btn_help"><span>新增币种汇率</span></a>
       </div>
         <div style="float:right;padding-right:20px;margin:0px;" class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
      </div>
    </form>
    <!--搜索栏结束-->

             <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
          
            <thead>
              <tr bgcolor="#EEEEEE">
                <th>编号</th>
                <th>货币符号</th>
                <th>货币名称</th>
                <th>汇率</th>
                <th>说明</th>
                <th>更新时间</th>
                <th>操作人员</th>
                <th>操作</th>
              </tr>
            </thead>
          
             {{foreach from=$rate_list item=res key=key}}
             <tr>
               <td height="20" align="center">{{$res.id}}</td>
               <td height="20" align="center">{{$res.name}}</td>
               <td height="20" align="center">{{$res.namecn}}</td>
               <td height="20" align="center">{{$res.rate}}</td>
               <td height="20" align="center">{{$res.descr}}</td>
               <td align="center">{{$res.opertime}}</td>
               <td height="20" align="center">{{$res.opername}}</td>
               <td align="center"><a href="javascript:void(0)" onClick="editRate({{$res.id}})">编辑</a> <a style="display:none" href="{{$detail.invoiceUrl}}">删除</a></td>
             </tr>
            {{/foreach}}
          </table>
      </div></div>
<form  method="post" id="bonanza_form" action="/MoneyRateManage/ajaxbutton?op=reviseRateInfo">
  <input type="hidden" name="data_id" id="data_id">
  <div class="modal fade" id="bonanzaForm" tabindex="-1" role="dialog" aria-labelledby="sshowamazon" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal"
                                aria-hidden="true">× </button>
          <h4 class="modal-title" id="sshowamazon">设置 <span id="rate_name"></span> 汇率信息</h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="right" width="20%">货币符号： </td>
              <td align="left"><input type="text" name="name" id="name" value="" style="width:200px;" maxlength="20"  class="small_input">
                <font color="#FF0000">(*)</font></td>
            </tr>
            <tr>
              <td align="right" width="20%">货币名称： </td>
              <td align="left"><input type="text" name="namecn" id="namecn" value="" style="width:200px;" maxlength="200"  class="small_input" />
                <font color="#FF0000">(*)</font></td>
            </tr>
            <tr>
              <td align="right">汇率： </td>
              <td align="left"><input type="text" name="rate" id="rate" value="" style="width:200px;" maxlength="200"  class="small_input" />
                <font color="#FF0000">(*)</font></td>
            </tr>
            <tr>
              <td align="right">说明： </td>
              <td align="left"><input type="text" name="descr" id="descr" value="" maxlength="200"  class="small_input" />
              <input type="hidden" name="refresh_token" id="refresh_token"></td>
            </tr>
          </table>
          <div class="modal-footer">
            
            <!--
                            <button type="button" class="btn btn-primary"  onclick="atmangban()">授权</button>-->
            <button type="button" class="btn btn-primary" onClick="formSubmit()">确定提交</button> 
            <button type="button" class="btn btn-default"
                                    data-dismiss="modal"> 关闭 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  <!-- /.modal -->
</form>
<script language="javascript" type="text/javascript">
//bonanza授权表单
function editRate(id){
	$("#data_id").val(id);
	$("#bonanza_form").attr("action",'/MoneyRateManage/ajaxbutton?op=reviseRateInfo');
	$.post("/MoneyRateManage/ajaxbutton?op=getRateDetail", {"id": id},
		function(ret){
			if(ret.id>0){
				$("#rate_name").html(ret.namecn);
				$("#namecn").val(ret.namecn);
				$("#name").val(ret.name);
				$("#rate").val(ret.rate);
				$("#descr").val(ret.descr);
			}else{
				//alert(data.msg);return ;
			}
	},"json");
	$('#bonanzaForm').modal('show');
}

function formSubmit(){
	if($("#name").val()==''){
		alert("货币符号不能为空");
	}else if($("#namecn").val()==''){
		alert("货币名称不能为空");
	}else if($("#rate").val()==''){
		alert("货币汇率不能为空");
	}else{
		$("#bonanza_form").submit();
	}
}
function addMoneyRate(){
	$("#bonanza_form").attr("action",'/MoneyRateManage/ajaxbutton?op=addMoneyRate');
	$("#sshowamazon").html("新增货币汇率");
	$("#namecn").val('');
	$("#name").val('');
	$("#rate").val('');
	$("#descr").val('');
	$('#bonanzaForm').modal('show');
}
</script>
</body>
</html>